<?php

namespace App\Http\Dao;

use App\Models\UserHistoryModel;
use App\Models\WechatUserModel;

class WechatUserDao extends BaseDao
{

    protected function getModel(): string
    {
        return WechatUserModel::class;
    }

    public function getUserInfo($openid)
    {
        return $this->getModel()::query()->where('openid', $openid)->first();
    }

    public function clearHistory($userId)
    {
        // 软删除
        return UserHistoryModel::query()->where('user_id', $userId)->delete();
    }
}
